//
//  SICPSDKService.h
//  test1
//
//  Created by Piccolo on 2017/4/19.
//  Copyright © 2017年 Piccolo. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "SICPSDKResultInfo.h"
#import "SICPSDKActiveReportInfo.h"
#import <CoreBluetooth/CoreBluetooth.h>
#import "SICPSDKPeripheral.h"
#import "SICPSDKCommon.h"
#import "SILightInfo.h"
#import "SILightAddtionalInfo.h"

#define SDK_VERSION @"0.0.1"
#define SDK_RELEASE_TIME @"2018-02-24"

@protocol SILightDelegate <NSObject>
@optional

- (void)requestResultInfo:(SICPSDKResultInfo *)info;
- (void)scanedPeripheral:(SICPSDKPeripheral *)smartItPeripheral;
- (void)currentRssi:(NSNumber *)rssi;
- (void)updateDBData;

- (void)requestInitSdkResultInfo:(SICPSDKResultInfo *)info;
- (void)requestDestroyResultInfo:(SICPSDKResultInfo *)info;
- (void)requestInitBleManagerResultInfo:(SICPSDKResultInfo *)info;
- (void)requestStopScanBle;
- (void)requestDisconnectResultInfo:(SICPSDKResultInfo *)info;
- (void)requestConnectResultInfo:(SICPSDKResultInfo *)info;
- (void)requestActiveReport:(SICPSDKActiveReportInfo *)smartITCampingLightActiveReportInfo;
- (void)requestDeviceResultInfo:(SICPSDKResultInfo *)info;
- (void)requestBluetoothDisabled;



@end


@interface SICPSDKService : NSObject
@property (nonatomic,weak) id<SILightDelegate>delegate;
@property (assign, nonatomic) BOOL bluetoothIsOn;
//+ (void)startBlueTooth:(id)delegate;

/**
 *获取单例对象的方法
 */

+ (void)initSDK;
+ (instancetype)sharedManager;
+ (SICPSDKPeripheral *)getCurrentBle;
+ (CBPeripheralState)getCurrentBleState;
+ (BOOL)getManagerScanning;
+ (void)setDelegate:(id)delegate;

+ (void)initBlueToothManager;
+ (void)startScan;
+ (void)stopScan;
+ (void)connectBlueTooth:(SICPSDKPeripheral *)per;
+ (void)disConnectBle;
//+ (void)registerKey:(NSArray *)syscode andRegcode:(NSArray *)regcode;
+ (void)destroyBle;
+ (void)manageActiveReportingValueOfCharacteristic:(NSData *)activeReportingValue;

/* 发送设置时间0x10 */
+ (void)sendSettingDeviceTime;
/* 发送设置值 0x20 */
+ (void)sendSettingBasicInfoFromLightInfo:(SILightInfo *)lightInfo;
/* 发送设置值 0x21 */
+ (void)sendSettingAwakenInfoFromLightInfo:(SILightInfo *)lightInfo;
/* 发送SOS 声控 指示灯 0x23 */
+ (void)sendAdditionalCommandFromLightAddtionalInfo:(SILightAddtionalInfo *)lightAddtionalInfo;
/* 发送修改设备名称 0x25 */
+ (void)sendSettingDeviceName:(NSString *)deviceName;

@end
